package com.lxy.ribbon.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author lixinyang
 * @className: TestController
 * @description: TODO
 * @date 2022/04/30日  14:00
 */

@RestController
public class TestController {

    @Autowired
    private RestTemplate restTemplate;

    private final String SERVICEURL = "http://sentineltest1";
    @GetMapping("/test")
    public String test() {
        return "远程调用结果：" + this.restTemplate.getForObject(SERVICEURL+"/sentinel2", String.class);
    }

}
